package com.example.demo.eight;

import com.example.demo.util.RabbitMQUtils;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;

import java.util.HashMap;
import java.util.Map;

/**
 * 死信队列
 *
 * @author chensixiang chensixiang1234@gmail.com
 */
public class Consumer02 {
    public static final String DEAD_QUEUE = "dead_queue";

    public static void main(String[] args) throws Exception {
        Channel channel = RabbitMQUtils.getChannel();
        System.out.println("等待接受消息......");

        channel.basicConsume(DEAD_QUEUE, true, (consumerTag, message) -> {
            System.out.println("Consumer02 消息为 -> " + new String(message.getBody()));
        }, (consumerTag, sig) -> {
        });
    }
}
